Wi-fi connection method, mobile terminal and storage medium

ABSTRACT

An embodiment provides a Wireless Fidelity (Wi-Fi) connection method and a mobile terminal. The method includes: a Wi-Fi connection method is provided, which is applied to a mobile terminal and includes: network environment information of a target Access Point (AP) is acquired; N target Wi-Fi connection records corresponding to the target AP is acquired from historical Wi-Fi connection data according to the network environment information of the target AP, the historical Wi-Fi connection data comprising M Wi-Fi connection records, where M is a positive integer and N is a positive integer less than or equal to M; and the target AP is accessed according to the N target Wi-Fi connection records.

CROSS-REFERENCE TO RELATED APPLICATION

This is a continuation application of U.S. application Ser. No.15/794,488, which claims priority of the Chinese patent application No.201710091100.3 filed on Feb. 20, 2017, which is incorporated into thepresent application by reference in its entity.

TECHNICAL FIELD

The disclosure relates to the technical field of communications, and inparticular to a Wireless Fidelity (Wi-Fi) connection method and a mobileterminal.

BACKGROUND

Along with rapid development of the information technology, use ofmobile terminals (such as mobile phone and tablet computer) becomesincreasingly popular. Users have higher requirements on the mobileterminals. They not only require the mobile terminal to have arelatively high processing speed, but also increasingly rely upon Wi-Ficonnection. Along with popularization of the mobile terminals and theWi-Fi, the event of accessing a Wi-Fi network through a mobile terminaloccurs more and more frequently.

SUMMARY

A first aspect of the embodiments of the disclosure provides a Wi-Ficonnection method, which is applied to a mobile terminal and includes:network environment information of a target Access Point (AP) isacquired; N target Wi-Fi connection records corresponding to the targetAP is acquired from historical Wi-Fi connection data according to thenetwork environment information of the target AP, the historical Wi-Ficonnection data comprising M Wi-Fi connection records, where M is apositive integer and N is a positive integer less than or equal to M;and the target AP is accessed according to the N target Wi-Fi connectionrecords.

A second aspect of the embodiments of the disclosure provides a mobileterminal, which includes: a processor and a memory, the processor callsa code or instruction in the memory to execute the Wi-Fi connectionmethod as described in the first aspect.

A third aspect of the embodiments of the disclosure provides anon-transitory computer readable storage medium, storing instructions,which, when executed by a processor, cause the processor to execute theWi-Fi connection method as described in the first aspect.

BRIEF DESCRIPTION OF DRAWINGS

In order to describe the technical solutions in the embodiments of thedisclosure more clearly, the drawings required to be used fordescriptions about the embodiments will be simply introduced below. Ofcourse, the drawings described below are some embodiments of thedisclosure. Those skilled in the art may further obtain other drawingsaccording to these drawings without creative work.

FIG. 1a illustrates a flowchart of a Wi-Fi connection method accordingto an embodiment of the disclosure.

FIG. 1b illustrates a flowchart of operations for acquiring N targetWi-Fi connection records from historical Wi-Fi connection data accordingto an embodiment of the disclosure.

FIG. 1c illustrates a flowchart of operations for accessing the targetAP according to the N target Wi-Fi connection records according to anembodiment of the disclosure.

FIG. 2 illustrates a flowchart of a Wi-Fi connection method according toan embodiment of the disclosure.

FIG. 3a illustrates a structure diagram of a mobile terminal accordingto an embodiment of the disclosure.

FIG. 3b illustrates a structure diagram of a second acquisition deviceof a mobile terminal described in FIG. 3a according to an embodiment ofthe disclosure.

FIG. 3c illustrates another structure diagram of a second acquisitiondevice of a mobile terminal described in FIG. 3a according to anembodiment of the disclosure.

FIG. 3d illustrates a structure diagram of a connector of a mobileterminal described in FIG. 3a according to an embodiment of thedisclosure.

FIG. 4 illustrates a structure diagram of a mobile terminal according toan embodiment of the disclosure.

DETAILED DESCRIPTION

The technical solutions in the embodiments of the disclosure will beclearly and completely described below in connection with the drawingsin the embodiments of the disclosure. Of course, the describedembodiments are not all embodiments but part of embodiments of thedisclosure. All other embodiments obtained on the basis of theembodiments in the disclosure by those skilled in the art withoutcreative work shall fall within the scope of protection of theinvention.

Terms “first”, “second”, “third”, “fourth” and the like in thespecification, claims and drawings of the disclosure are intended not todescribe a specific sequence but only to distinguish different objects.In addition, terms “include” and “have” and any transformation thereofare intended to cover nonexclusive inclusions. For example, a process,method, system, product or equipment including a series of operations orunits is not limited to the listed operations or units, but may furtherinclude operations or units which are not listed, or may further includeother operations or units intrinsic to the process, the method, theproduct or the equipment.

“Embodiment” mentioned in the disclosure means that specificcharacteristics, structures or properties described with reference to anembodiment may be included in at least one embodiment of the disclosure.This word displayed at each position in the specification does not referto the same embodiment as well as an independent or alternate embodimentmutually exclusive to other embodiments. It may be explicitly andimplicitly understood by those skilled in the art that the embodimentsdescribed in the disclosure may be combined with the other embodiments.

A mobile terminal described in the embodiments of the disclosure mayinclude a smart phone (such as an Android phone, an iOS phone and aWindows phone), a tablet computer, a palmtop computer, a notebookcomputer, a Mobile Internet Device (MID), wearable equipment or thelike, which are not exhausted by only listed as examples, and includes,but not limited to, the listed mobile terminals.

Normally, in order to access an Access Point (AP), all of the ServiceSet Identifier (SSID), the encryption scheme and the password of the APbeing inputted shall be correct. In practice, when a user arrives at aplace, he/she may have to take some efforts to obtain the password ofthe AP for connection. However, due to some maloperation in use or thelimitation of the number of APs stored in a mobile terminal, some APrecords may be cleared. In this case, the user has to input the passwordagain for accessing the AP which has ever been accessed before. If thepassword is incorrectly input for multiple times, Wi-Fi connectionefficiency becomes very low.

In at least one embodiment, historical Wi-Fi connection data in theembodiments of the disclosure may include multiple Wi-Fi connectionrecords, and each Wi-Fi connection record may include an AP which hasever been connected (that is, the AP is successfully accessed). Ofcourse, each Wi-Fi connection record may further include attributeinformation of the AP and network environment information (such as aposition of a mobile terminal, signal strengths and the like ofsurrounding APs and attribute information of the surrounding APs), andthe attribute information may include at least one of: an SSID, a BasicSSID (BSSID), an encryption scheme, a password and the like. Of course,every time when the mobile terminal successfully accesses a certain AP,a Wi-Fi connection record may be generated, and an SSID, BSSID,encryption scheme and password of the AP and the position of the mobileterminal are recorded.

In some embodiments of the disclosure, a Wi-Fi connection method isprovided, which is applied to a mobile terminal and includes: networkenvironment information of a target Access Point (AP) is acquired; Ntarget Wi-Fi connection records corresponding to the target AP isacquired from historical Wi-Fi connection data according to the networkenvironment information of the target AP, the historical Wi-Ficonnection data comprising M Wi-Fi connection records, where M is apositive integer and N is a positive integer less than or equal to M;and the target AP is accessed according to the N target Wi-Fi connectionrecords.

In some embodiments of the disclosure, a mobile terminal is provided,which includes: a processor and a memory, the processor calls a code orinstruction in the memory to execute the Wi-Fi connection method asdescribed above.

In some embodiments of the disclosure, a non-transitory computerreadable storage medium is provided, the non-transitory computerreadable storage medium stores instructions, which, when executed by aprocessor, cause the processor to execute the Wi-Fi connection method asdescribed above.

FIG. 1a illustrates a flowchart of a Wi-Fi connection method accordingto an embodiment of the disclosure. The Wi-Fi connection methoddescribed in the embodiment includes the following operations in blocksillustrated in FIG. 1a . The method can begin at block 101.

At block 101, a first password for accessing a target AP, input by auser, is acquired.

Here, the first password may be at least one of: a character string,fingerprint information, voice information, iris information and thelike. A mobile terminal may display a Wi-Fi list in a display screen ofthe mobile terminal. The Wi-Fi list may include AP information ofmultiple APs, the target AP may be selected, and the user may input thefirst password of the target AP.

At block 102, when authentication with the first password fails, Ntarget Wi-Fi connection records corresponding to the target AP areacquired from historical Wi-Fi connection data according to networkenvironment information of the target AP, the historical Wi-Ficonnection data including M Wi-Fi connection records, where M is apositive integer and N is a positive integer less than or equal to M.

Here, the target AP may perform authentication with the first password,and may allow the mobile terminal to access the target AP when theauthentication with the first password succeeds. When the authenticationwith the first password fails, the N target Wi-Fi connection recordscorresponding to the target AP may be acquired from the historical Wi-Ficonnection data according to the network environment information of thetarget AP. For example, the N target Wi-Fi connection recordscorresponding to the target AP may be acquired from the historical Wi-Ficonnection data according to an SSID of the target AP. For anotherexample, the N target Wi-Fi connection records corresponding to thetarget AP may be acquired from the historical Wi-Fi connection dataaccording to an encryption scheme of the target AP. For another example,the N target Wi-Fi connection records corresponding to the target AP maybe acquired from the historical Wi-Fi connection data according to theSSID and encryption scheme of the target AP.

In at least one embodiment, each Wi-Fi connection record includes APinformation of an AP and a position of a mobile terminal. Acquisition ofthe N target Wi-Fi connection records corresponding to the target APfrom the historical Wi-Fi connection data according to the networkenvironment information of the target AP in block 102 may include thefollowing operations, as illustrated in FIG. 1 b.

At operation 21, a current position of the mobile terminal is acquired.

At operation 22, P Wi-Fi connection records including positions of themobile terminal in a preset range which is centered at the currentposition are determined from the historical Wi-Fi connection data.

At operation 23, the N target Wi-Fi connection records are selected fromthe P Wi-Fi connection records according to a BSSID of the target AP,where P is an integer greater than or equal to N.

Here, the mobile terminal may determine the current position of themobile terminal through a Global Positioning System (GPS), or, themobile terminal may determine the current position of the mobileterminal through a Wi-Fi positioning technology. The current position ofthe mobile terminal may be represented by a latitude and a longitude.For example, the current position may be represented to be 113° 46′ castlongitude and 22° 27′ north latitude. Of course, if the current positionof the mobile terminal is determined by adopting the Wi-Fi positioningtechnology, a position of a certain AP found by a current cycle of Wi-Fiscanning is determined as the position of the mobile terminal, and theposition of the AP, if being marked on an indoor map, may be determinedas a point (which represents the position of the mobile terminal).

For example, every time when the user is successfully connected to anAP, a BSSID and password of the AP and the position of the mobileterminal may be recorded to form Wi-Fi connection information of the AP,which is stored in a certain file of the mobile terminal. The file maybe set to be input-only, and is configured to record information of allAPs which have ever been accessed, thereby obtaining historical Wi-Ficonnection data. When the user inputs a password for accessing a certainAP, if the password is incorrect, the mobile terminal, according to thecurrent position of the mobile terminal, searches historical records forall APs which have ever been accessed and have the same BSSID in apreset range (for example, a range of 10 meters) of the position, and APinformation in these Wi-Fi connection records is stored in a presetlist. If there is only one record in the preset list, a password of amatched AP is adopted for connection, and if there are multiple APs, thetarget AP is connected by traversing with passwords of these APs.Therefore, a success rate of AP connection may be increased.

In at least one embodiment, acquisition of the N target Wi-Fi connectionrecords corresponding to the target AP from the historical Wi-Ficonnection data according to the network environment information of thetarget AP in block 102 may include the following operations.

At operation 24, BSSIDs of M APs of which signal strength values arehigher than a preset threshold value around the target AP are acquired,where M is a positive integer.

At operation 25, Q Wi-Fi connection records are determined from thehistorical Wi-Fi connection data according to an SSID and encryptionscheme of the target AP.

At operation 26, the BSSIDs of the M APs are matched with neighborinformation in each target Wi-Fi connection record in the Q target Wi-Ficonnection records to obtain the N target Wi-Fi connection records, Herethe neighbor information in the target Wi-Fi connection records includesthe BSSIDs of X APs in the BSSIDs of the M APs, where X is a positiveinteger less than or equal to M.

Here, the neighbor information in each target Wi-Fi connection recordmainly refers to that neighbor information of an AP is formed byattribute information of APs of which signal strength is higher than acertain threshold value around the AP when the mobile terminal isconnected to the AP. X may be set by the user or may be a system defaultvalue. For example, every time when the user is successfully connectedto an AP, an SSID, BSSID, encryption scheme and password of the AP andat most M (for example, M=5) surrounding APs of which signal strengthsare higher than a preset threshold value R (for example, R=−80 db)(these surrounding APs meeting this condition may be called neighborinformation of the AP) are recorded. All the information formshistorical Wi-Fi connection data of the AP, and is stored in a certainfile of the mobile terminal together. The file is set to be input-only,and records Wi-Fi connection records of all APs which have ever beenconnected. The user inputs a password for accessing a certain AP. If thepassword is incorrect, a Wi-Fi list is acquired, the Wi-Fi list ismatched with information of APs stored in historical Wi-Fi connectiondata according to information (SSIDs, BSSIDs and encryption schemes) ofcurrently found APs in combination with an environment where the AP iscurrently located (at most M found APs of which signal strengths arehigher than R are extracted), and if an SSID (BSSID) or/and encryptionscheme of the AP is/are the same as the APs stored in the historicalWi-Fi connection data and the BSSIDs of the M found APs are equal toBSSIDs of at least N (N<M, for example, N=3) APs in neighbor informationof the AP in historical records, it is determined that the matchingsucceeds.

At block 103, the target AP is accessed according to the N target Wi-Ficonnection records.

Here, the N target Wi-Fi connection records include N passwords, so thatthe target AP may be accessed according to the N passwords respectively;and if the password of the target AP is one of the N passwords, thetarget AP may be accessed in the N cycles of trying process.

In at least one embodiment, the target AP is accessed according to the Ntarget Wi-Fi connection records in block 103 may include the followingoperations, as illustrated in FIG. 1 c.

At operation 31, the N target Wi-Fi connection records are stored in apreset list.

At operation 32, K passwords corresponding to the N target Wi-Ficonnection records in the preset list are acquired, where K is aninteger less than or equal to N.

At operation 33, the target AP is accessed according to the K passwords.

Here, the mobile terminal may store the N target Wi-Fi connectionrecords in the preset list, and the preset list may be set by the user(for example, specific entries in the preset list, for example, thepreset list may include multiple records and each record includes anSSID, a BSSID, an encryption scheme and a password). As shown in Table1, an example of the preset list is shown. Of course, the preset listmay also be displayed in the display screen of the mobile terminal.Passwords may be extracted from the preset list. Since the N targetWi-Fi connection records may include at least two Wi-Fi connectionrecords with the same password, the K passwords may be obtained, where Kis an integer less than or equal to N. Then, the target AP is accessedaccording to the K passwords. For example, when K is 3, the threepasswords are “abcded”. “112239” and “xxx123” respectively. Firstly, thepassword “abcded” may be used to access the target AP; in case offailure, then the password “12239” may be used to access the target AP;in case of failure, then the password “xxx123” may be used to access thetarget AP.

TABLE 1 AP SSID BSSID Encryption scheme password 1 Cathay A1 WPA_PSK888888 2 118 B1 WPA_PSK Admini 3 China-net C1 WPA_PSK 1 + 1 = 2

The embodiment of the disclosure may be applied to the followingspecific application scenario. For example, the user adds a hidden AP,and inputs an SSID, an encryption scheme and a password. Whether an APwith the same SSID and encryption scheme exists in a configuration of astored AP or not is detected, and if YES, a password of the stored AP isbacked up before the configuration of the AP is covered. If an incorrectpassword is input for connection, it is prompted that the password isincorrect. If the password is incorrect, a configuration of the added APis modified, and the password of the AP is remodified into the passwordwhich is backed up before. In this way, it may be ensured that the APwhich is stored before may still be connected, and the problem ofincorrect password may be solved. For example, the configuration of theAP stored before includes: the SSID “TEST”, the encryption scheme“WAP_PSK” and the password “12345678”, the configuration of the addedhidden AP includes: the SSID “TEST”, the encryption scheme “WPA_PSK” andthe password “00000000”, then the password of “TEST” may be covered by“00000000” in the adding process, which may make the AP stored beforecannot be normally connected, and if connection to the added hidden APfails, the password is recovered to be “12345678”, and then the APstored before can still be normally connected.

It can be seen that, according to the embodiment of the disclosure, afirst password for accessing a target AP, input by a user, is acquired;when authentication with the first password fails, N target Wi-Ficonnection records corresponding to the target AP are acquired fromhistorical Wi-Fi connection data according to network environmentinformation of the target AP, the historical Wi-Fi connection dataincluding M Wi-Fi connection records, where M is a positive integer andN is a positive integer less than or equal to M; and the target AP isaccessed according to the N target Wi-Fi connection records. Therefore,the Wi-Fi connection records of the target AP may be acquired from thehistorical Wi-Fi connection data, the target AP may be accessedaccording to the Wi-Fi connection records. In this way, Wi-Fi connectionefficiency may be improved.

FIG. 2 illustrates a flowchart of a Wi-Fi connection method according toan embodiment of the disclosure. The Wi-Fi connection method describedin the embodiment includes the following operations in blocksillustrated in FIG. 2. The method can begin from block 201.

At block 201, a first password for accessing a target AP, input by auser, is acquired.

At block 202, when authentication with the first password fails, Ntarget Wi-Fi connection records corresponding to the target AP areacquired from historical Wi-Fi connection data according to networkenvironment information of the target AP, the historical Wi-Ficonnection data including M Wi-Fi connection records, where M is apositive integer and N is a positive integer less than or equal to M.

At block 203, the N target Wi-Fi connection records are stored in apreset list.

Here, a mobile terminal may store the N target Wi-Fi connection recordsin the preset list, and the preset list may be set by the user (forexample, specific entries in the preset list). Of course, the presetlist may also be displayed in a display screen of the mobile terminal.Passwords may be extracted from the preset list. Since the N targetWi-Fi connection records may include at least two Wi-Fi connectionrecords with the same password, K passwords may be obtained, where K isan integer less than or equal to N. Then, the target AP may be accessedaccording to the K passwords. For example, when K is 3, the threepasswords are “abcded”, “112239” and “xxx123” respectively. Firstly, thepassword “abcded” may be used to access the target AP; in case offailure, then the password “112239” may be used to access the target AP;in case of failure, then the password “xxx123” may be used to access thetarget AP.

At block 204, acquiring K passwords corresponding to the N target Wi-Ficonnection records in the preset list are acquired, where K is aninteger less than or equal to N.

At block 205, an occurrence frequency of each of the K passwords in thepreset list are determined to obtain K frequency values.

Here, the N target Wi-Fi connection records may at most include Ndifferent passwords. However, normally, places for activities of theuser are relatively concentrated, so that the same AP may be accessed inthe same place for activities, and a used password may also be the same.Therefore, K different passwords may exist in the N target Wi-Ficonnection records, the occurrence frequency of each of the K passwordsin the N target Wi-Fi connection records is also different, and a ratioof the occurrence frequency of each password to N may be determined asthe frequency of the password. In this way, the frequency of each of theK passwords may be determined.

At block 206, a priority sequence of the K passwords is determinedaccording to the K frequency values.

Here, a principle for determining the priority sequence in theembodiment of the disclosure is that: if a frequency value is higher, apriority is higher, or, if the frequency value is lower, the priority islower.

At block 207, a password is selected from the K passwords according tothe priority sequence, and the target AP is accessed according to anSSID and encryption scheme of the target AP.

Here, after the priority sequence is determined, the password may beselected from the K passwords according to the priority sequence. Forexample, there are three passwords A, B and C, and correspondingfrequency values thereof are a1, b1 and c1, Here, c1>a1>b1. If apriority sequence is determined according to a principle that a priorityis higher if a frequency value is higher, the password C may be firstlyselected, and the target AP may be accessed according to the password Cand the SSID and encryption scheme of the target AP. In case of failure,the password A may be selected, the target AP may be accessed accordingto the password A and the SSID and encryption scheme of the target AP,and so on.

It can be seen that, according to the embodiment of the disclosure, afirst password for accessing a target AP, input by a user, is acquired;when authentication with the first password fails, N target Wi-Ficonnection records corresponding to the target AP are acquired fromhistorical Wi-Fi connection data according to network environmentinformation of the target AP, the historical Wi-Fi connection dataincluding M Wi-Fi connection records, where M is a positive integer andN is a positive integer less than or equal to M; the N target Wi-Ficonnection records are stored in the preset list; the K passwordscorresponding to the N target Wi-Fi connection records in the presetlist are acquired, where K is an integer less than or equal to N; theoccurrence frequency of each of the K passwords in the preset list isdetermined to obtain the K frequency values; the priority sequence ofthe K passwords is determined according to the K frequency values; thepassword is selected from the K passwords according to the prioritysequence; and the target AP is accessed according to the SSID andencryption scheme of the target AP. Therefore, the Wi-Fi connectionrecords of the target AP may be acquired from the historical Wi-Ficonnection data, and the target AP may be accessed according to theWi-Fi connection records. In this way, Wi-Fi connection efficiency maybe improved.

The below is a device for implementing the abovementioned Wi-Ficonnection method, specifically as follows.

FIG. 3a illustrates a structure diagram of a mobile terminal accordingto an embodiment of the disclosure. The mobile terminal described in theembodiment includes: a first acquisition device 301, a secondacquisition device 302 and a connector 303, specifically as follows.

The first acquisition device 301 is configured to acquire a firstpassword for accessing a target AP input by a user.

The second acquisition device 302 is configured to, when authenticationwith the first password fails, acquire N target Wi-Fi connection recordscorresponding to the target AP from historical Wi-Fi connection dataaccording to network environment information of the target AP, thehistorical Wi-Fi connection data including M Wi-Fi connection records,where M is a positive integer and N is a positive integer less than orequal to M.

The connector 303 is configured to access the target AP according to theN target Wi-Fi connection records.

In at least one embodiment, as shown in FIG. 3b , FIG. 3b illustrates aspecific detailed structure of the second acquisition device 302 of themobile terminal described in FIG. 3a . Each Wi-Fi connection recordincludes AP information of an AP and a position of the mobile terminal.The second acquisition device 302 may include: a first acquisition part3021, a first determination part 3022 and a selector 3023, specificallyas follows.

The first acquisition part 3021 is configured to acquire a currentposition of the target AP.

The first determination part 3022 is configured to determine P Wi-Ficonnection records including positions of the mobile terminal in apreset range which is centered at the current position from thehistorical Wi-Fi connection data.

The selector 3023 is configured to select the N target Wi-Fi connectionrecords from the P Wi-Fi connection records according to a BSSID of thetarget AP, where P is an integer greater than or equal to N.

In at least one embodiment, as shown in FIG. 3c . FIG. 3c illustratesanother specific detailed structure of the second acquisition device 302of the mobile terminal described in FIG. 3a . The second acquisitiondevice 302 may include: a second acquisition part 3024, a seconddetermination part 3025 and a matching part 3026, specifically asfollows.

The second acquisition part 3024 is configured to acquire BSSIDs of MAPs of which signal strength values are higher than a preset thresholdvalue around the target AP.

The second determination part 3025 is configured to determine Q Wi-Ficonnection records from the historical Wi-Fi connection data accordingto an SSID and encryption scheme of the target AP.

The matching part 3026 is configured to match the BSSIDs of the M APswith neighbor information in each target Wi-Fi connection record in theQ target Wi-Fi connection records to obtain the N target Wi-Ficonnection records. The neighbor information in the target Wi-Ficonnection records includes the BSSIDs of X APs adjacent to the APs inthe target Wi-Fi connection records.

In at least one embodiment, as shown in FIG. 3d , FIG. 3d illustratesanother specific detailed structure of the connector 303 of the mobileterminal described in FIG. 3a . The connector 303 may include: a storage3031, a third acquisition part 3032 and a first connection part 3033,specifically as follows.

The storage 3031 is configured to store the N target Wi-Fi connectionrecords in a preset list.

The third acquisition part 3032 is configured to acquire K passwordscorresponding to the N target Wi-Fi connection records in the presetlist, where K is an integer less than or equal to N.

The first access part 3033 is configured to access the target APaccording to the K passwords.

Further, in at least one embodiment, the first connection part 3033 mayinclude: a third determination part (not shown) and a second connectionpart (not shown), specifically as follows.

The third determination part is configured to determine an occurrencefrequency of each of the K passwords in the preset list to obtain Kfrequency values.

The third determination part is further specifically configured todetermine a priority sequence of the K passwords according to the Kfrequency values.

The second connection part is configured to select a password from the Kpasswords according to the priority sequence, and access the target APaccording to the SSID and encryption scheme of the target AP.

It can be seen that, according to the mobile terminal described in theembodiment of the disclosure, a first password for accessing a targetAP, input by a user, is acquired; when authentication with the firstpassword fails, N target Wi-Fi connection records corresponding to thetarget AP are acquired from historical Wi-Fi connection data accordingto network environment information of the target AP, the historicalWi-Fi connection data including M Wi-Fi connection records, where M is apositive integer and N is a positive integer less than or equal to M;and the target AP is accessed according to the N target Wi-Fi connectionrecords. Therefore, the Wi-Fi connection records of the target AP may beacquired from the historical Wi-Fi connection data, the target AP may beaccessed according to the Wi-Fi connection records. In this way, Wi-Ficonnection efficiency may be improved.

FIG. 4 illustrates a structure diagram of a mobile terminal according toan embodiment of the disclosure. The mobile terminal described in theembodiment includes: at least one input device 1000, at least one outputdevice 2000, at least one processor 3000, such as a Central ProcessingUnit (CPU), and a memory 4000, the input device 1000, the output device2000, the processor 3000 and the memory 4000 being connected through abus 5000.

Here, the input device 1000 may specifically be a touch panel, aphysical button or a mouse.

The output device 2000 may specifically be a display screen.

The memory 4000 may be a high-speed Random Access Memory (RAM), and mayalso be a non-volatile memory, such as a disk memory. The memory 4000 isconfigured to store a set of program codes, and the input device 1000,the output device 2000 and the processor 3000 are configured to call theprogram codes stored in the memory 4000 to execute the followingoperations.

The processor 3000 is configured to: acquire a first password foraccessing a target AP input by a user; when authentication with thefirst password fails, acquire N target Wi-Fi connection recordscorresponding to the target AP from historical Wi-Fi connection dataaccording to network environment information of the target AP, thehistorical Wi-Fi connection data including M Wi-Fi connection records. %here M is a positive integer and N is a positive integer less than orequal to M; and access the target AP according to the N target Wi-Ficonnection records.

In at least one embodiment, each Wi-Fi connection record includes APinformation of an AP and a position of the mobile terminal, and theoperation that the processor 3000 acquires the N target Wi-Fi connectionrecords corresponding to the target AP from the historical Wi-Ficonnection data according to the network environment information of thetarget AP includes that: a current position of the mobile terminal isacquired; P Wi-Fi connection records including positions of the mobileterminal in a preset range which is centered at the current position aredetermined from the historical Wi-Fi connection data; and the N targetWi-Fi connection records are selected from the P Wi-Fi connectionrecords according to a BSSID of the target AP, where P is an integergreater than or equal to N.

In at least one embodiment, the operation that the processor 3000acquires the N target Wi-Fi connection records corresponding to thetarget AP from the historical Wi-Fi connection data according to thenetwork environment information of the target AP includes that: BSSIDsof M APs of which signal strength values are higher than a presetthreshold value around the target AP are acquired, where M is a positiveinteger, Q Wi-Fi connection records are determined from the historicalWi-Fi connection data according to an SSID and encryption scheme of thetarget AP; and the BSSIDs of the M APs are matched with neighborinformation in each target Wi-Fi connection record in the Q target Wi-Ficonnection records to obtain the N target Wi-Fi connection records, Herethe neighbor information in the target Wi-Fi connection records includesthe BSSIDs of X APs in the BSSIDs of the M APs, where X is a positiveinteger less than or equal to M.

In at least one embodiment, the operation that the processor 3000accesses the target AP according to the N target Wi-Fi connectionrecords includes: the N target Wi-Fi connection records are stored in apreset list; K passwords corresponding to the N target Wi-Fi connectionrecords in the preset list are acquired, where K is an integer less thanor equal to N; and the target AP is accessed according to the Kpasswords.

Further, in at least one embodiment, the operation that the processor3000 accesses the target AP according to the K passwords includes: anoccurrence frequency of each of the K passwords in the preset list aredetermined to obtain K frequency values; a priority sequence of the Kpasswords is determined according to the K frequency values; and apassword is selected from the K passwords according to the prioritysequence, and the target AP is accessed according to the SSID andencryption scheme of the target AP.

An embodiment of the disclosure further provides a computer storagemedium, Here the computer storage medium may store a program, and whenthe program is executed, part or all of operations of any Wi-Ficonnection method recorded in the abovementioned method embodiments areincluded.

Although the invention is described herein with reference to eachembodiment, those skilled in the art may understand and implement othervariations of the disclosed embodiments by viewing the drawings, thedisclosed contents and the appended claims in a process of implementingthe invention required to be protected. In the claims, “comprising” doesnot exclude other parts or steps, and “a” or “one” does not exclude amultiple condition. A single processor or another unit may realize aplurality of functions listed in the claims. Some measures are recordedin different claims, but it does not mean that these measures cannot becombined to achieve good effects.

Those skilled in the art should know that the embodiment of thedisclosure may be provided as a method, a device (equipment) or acomputer program product. Therefore, the invention may adopt a form ofpure hardware embodiment, pure software embodiment or combined softwareand hardware embodiment. Moreover, the invention may adopt a form ofcomputer program product implemented on one or more computer-availablestorage media (including, but not limited to, a disk memory, a CompactDisc Read-Only Memory (CD-ROM) and an optical memory) includingcomputer-available program codes. The computer program isstored/distributed in a proper medium and is provided together withother hardware or serves as a part of the hardware, and may also bedistributed in another form, for example, through the Internet oranother wired or wireless telecommunication system.

The invention is described with reference to flowcharts and/or blockdiagrams of the method, device (equipment) and computer program productaccording to the embodiment of the disclosure. It should be understoodthat each flow and/or block in the flowcharts and/or the block diagramsand combinations of the flows and/or blocks in the flowcharts and/or theblock diagrams may be implemented by computer program instructions.These computer program instructions may be provided for a universalcomputer, a dedicated computer, an embedded processor or a processor ofother programmable data processing device to generate a machine, so thata device for realizing a function specified in one flow or more flows inthe flowcharts and/or one block or more blocks in the block diagrams isgenerated by the instructions executed through the computer or theprocessor of the other programmable data processing device.

These computer program instructions may also be stored in acomputer-readable memory capable of guiding the computer or the otherprogrammable data processing device to work in a specific manner, sothat a product including an instruction device may be generated by theinstructions stored in the computer-readable memory, the instructiondevice realizing the function specified in one flow or many flows in theflowcharts and/or one block or many blocks in the block diagrams.

These computer program instructions may further be loaded onto thecomputer or the other programmable data processing device, so that aseries of operating steps are executed on the computer or the otherprogrammable data processing device to generate processing implementedby the computer, and steps for realizing the function specified in oneflow or many flows in the flowcharts and/or one block or many blocks inthe block diagrams are provided by the instructions executed on thecomputer or the other programmable data processing device.

Although the invention is described with reference to specificcharacteristics and the embodiments, obviously, various modificationsand combinations may be made to the invention without departing from thespirit and scope of the invention. Correspondingly, the specificationand the drawings are only exemplary descriptions about the inventiondefined by the appended claims, and are considered to cover any and allmodifications, variations, combinations or equivalents in the scope ofthe invention. Obviously, those skilled in the art may make variousmodifications and transformations to the invention without departingfrom the spirit and scope of the invention. Therefore, if thesemodifications and transformations of the invention belong to the scopeof the claims of the invention and equivalent technologies thereof, theinvention is also intended to include these modifications andtransformations.

1. A Wireless Fidelity (Wi-Fi) connection method, the method comprising:acquiring a first password for accessing a target Access Point (AP)input by a user; when authentication with the first password fails,acquiring N target Wi-Fi connection records corresponding to the targetAP from historical Wi-Fi connection data according to the networkenvironment information of the target AP, the historical Wi-Ficonnection data comprising M Wi-Fi connection records, where M is apositive integer and N is a positive integer less than or equal to M;and accessing the target AP according to the N target Wi-Fi connectionrecords.
 2. The method according to claim 1, wherein each Wi-Ficonnection record comprises information of an AP and a position of themobile terminal, and wherein the acquiring the N target Wi-Fi connectionrecords corresponding to the target AP from the historical Wi-Ficonnection data according to the network environment information of thetarget AP comprises: acquiring a current position of the mobileterminal; determining, from the historical Wi-Fi connection data, PWi-Fi connection records comprising positions of the mobile terminal ina preset range which is centered at the current position; and selectingthe N target Wi-Fi connection records from the P Wi-Fi connectionrecords according to a Basic Service Set Identifier (BSSID) of thetarget AP, where P is an integer greater than or equal to N.
 3. Themethod according to claim 1, wherein the acquiring N target Wi-Ficonnection records corresponding to the target AP from historical Wi-Ficonnection data according to the network environment information of thetarget AP comprises: acquiring BBSIDs of M APs of which signal strengthvalues are higher than a preset threshold value, around the target AP,where M is a positive integer; determining Q Wi-Fi connection recordsfrom the historical Wi-Fi connection data according to a Service SetIdentifier (SSID) and an encryption scheme of the target AP, wherein Qis a positive integer; and matching the BBSIDs of the M APs withneighbor information corresponding to each of the Q target Wi-Ficonnection records to obtain the N target Wi-Fi connection records,wherein the neighbor information corresponding to the target Wi-Ficonnection records comprises the BBSIDs of X APs in the BBSIDs of the MAPs, where X is a positive integer less than or equal to M.
 4. Themethod according to claim 2, wherein the accessing the target APaccording to the N target Wi-Fi connection records comprises: storingthe N target Wi-Fi connection records in a preset list; acquiring Kpasswords corresponding to the N target Wi-Fi connection records in thepreset list, where K is an integer less than or equal to N; andaccessing the target AP according to the K passwords.
 5. The methodaccording to claim 4, wherein the accessing the target AP according tothe K passwords comprises: determining an occurrence frequency of eachof the K passwords in the preset list to obtain K frequency values;determining a priority sequence of the K passwords according to the Kfrequency values; selecting a password from the K passwords, accordingto the priority sequence; and accessing the target AP according to theSSID of the target AP and the encryption scheme.
 6. A mobile terminal,comprising: a processor and a memory, wherein the processor calls a codeor instruction in the memory to execute a Wireless Fidelity (Wi-Fi)connection method, the method comprising: acquiring a first password foraccessing a target Access Point (AP) input by a user: whenauthentication with the first password fails, acquiring N targetWireless Fidelity (Wi-Fi) connection records corresponding to the targetAP from historical Wi-Fi connection data according to the networkenvironment information of the target AP, the historical Wi-Ficonnection data comprising M Wi-Fi connection records, where M is apositive integer and N is a positive integer less than or equal to M;and accessing the target AP according to the N target Wi-Fi connectionrecords.
 7. The mobile terminal according to claim 6, wherein each Wi-Ficonnection record comprises information of an AP and a current positionof the mobile terminal, and wherein the acquiring the N target Wi-Ficonnection records corresponding to the target AP from the historicalWi-Fi connection data according to the network environment informationof the target AP comprises: acquiring a current position of the targetAP; determining, from the historical Wi-Fi connection data, P Wi-Ficonnection records comprising positions of the mobile terminal in apreset range which is centered at the current position; and selectingthe N target Wi-Fi connection records from the P Wi-Fi connectionrecords according to a Basic Service Set Identifier (BSSID) of thetarget AP, where P is an integer greater than or equal to N.
 8. Themobile terminal according to claim 6, wherein the acquiring N targetWi-Fi connection records corresponding to the target AP from historicalWi-Fi connection data according to the network environment informationof the target AP comprises: acquiring BBSIDs of M APs of which signalstrength values are higher than a preset threshold value, around thetarget AP, where M is a positive integer; determining Q Wi-Fi connectionrecords from the historical Wi-Fi connection data according to a ServiceSet Identifier (SSID) and encryption scheme of the target AP, wherein Qis a positive integer; and matching the BBSIDs of the M APs withneighbor information corresponding to each of the Q target Wi-Ficonnection records to obtain the N target Wi-Fi connection records,wherein the neighbor information corresponding to the target Wi-Ficonnection records comprises the BBSIDs of X APs in the BBSIDs of the MAPs, where X is a positive integer less than or equal to M.
 9. Themobile terminal according to claim 7, wherein the accessing the targetAP according to the N target Wi-Fi connection records comprises: storingthe N target Wi-Fi connection records in a preset list; acquiring Kpasswords corresponding to the N target Wi-Fi connection records in thepreset list, where K is an integer less than or equal to N; andaccessing the target AP according to the K passwords.
 10. The mobileterminal according to claim 8, wherein the accessing the target APaccording to one of the K passwords comprises: determining an occurrencefrequency of each of the K passwords in the preset list to obtain Kfrequency values; determining a priority sequence of the K passwordsaccording to the K frequency values; and selecting a password from the Kpasswords according to the priority sequence, and accessing the targetAP according to the SSID of the target AP and the encryption scheme.